/**
 * Created by liguangsong on 16/8/15.
 */
$(document).ready(function() {

    modifyShopCarNumber();

    $("#go").click(function() {
        window.location.href = "/goodList/";
    });

    $("#to_main").click(function() {
        window.location.href = "/";
    });

    $("#to_goodsList").click(function() {
        window.location.href = "/goodList/";
    });

    $("#to_shop_car").click(function() {
        window.location.href = "/shoppingCar/";
    })
});


function modifyShopCarNumber() {

    $.get('/ajax_setShopping/', function(result){
        var count = 0;
        _.times(result.length, function(i){
            count += parseInt(result[i]["count"]);
        });

        $(".nav_shop_car p span").text(" (" +  count + ")");

    })   

}

